﻿using System;
using System.Linq;
using BONSAI.BLL;

namespace BONSAI.UI.Pages
{
    public partial class Payment : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                BindPayment();
            }
        }
        private void BindPayment()
        {
            var lst = (new PaymentsBO()).GetAll();
            
            if (lst != null)
            {
                var lst1 = lst.Where(x => x.IsBank == 0).ToList();
                var lst2 = lst.Where(x => x.IsBank == 1).ToList();

                Repeater1.DataSource = lst1;
                Repeater1.DataBind();

                Repeater2.DataSource = lst2;
                Repeater2.DataBind();

            }
        }
    }
}